package cn.com.homeyoda.aimate.aihealth.ui.health;

import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.MediaController;
import android.widget.VideoView;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import cn.com.homeyoda.aimate.aihealth.R;
import cn.com.homeyoda.aimate.aihealth.base.BaseActivity;

public class VideoPlayActivity extends AppCompatActivity {

    String videoUrl = "";

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_video_play);

        videoUrl = getIntent().getExtras().getString("videoUrl");
        Log.d("pangtao", "url = " + videoUrl);

        VideoView videoView = findViewById(R.id.video_view);
        videoView.setVideoPath(videoUrl);
        videoView.start();
        MediaController mediaController = new MediaController(this);
        videoView.setMediaController(mediaController);
        mediaController.setMediaPlayer(videoView);

        findViewById(R.id.back).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }
}
